//
//  YDAAboutUsCell.m
//  siyanone
//
//  Created by LK-IOS on 2018/3/26.
//  Copyright © 2018年 LK-News. All rights reserved.
//

#import "YDAAboutUsCell.h"

@interface YDAAboutUsCell()

//分割线
@property (nonatomic , weak) UIView *lineView;
//
@property (nonatomic , weak) UILabel *cateLabel;

//acc
@property (nonatomic , weak) UIImageView *accImage;

@end

@implementation YDAAboutUsCell

-(void)setCateLabelString:(NSString *)cateLabelString
{
    _cateLabelString = cateLabelString;
    
    self.cateLabel.text = cateLabelString;
}

+ (instancetype)cellWithTableview:(UITableView *)tableview
{
    static NSString *const aAboutUsCell = @"YDAAboutUsCell";
    
    YDAAboutUsCell *cell = [tableview dequeueReusableCellWithIdentifier:aAboutUsCell];
    if (cell == nil) {
        cell = [[YDAAboutUsCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:aAboutUsCell];
    }
    return cell;
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self lineView];
        [self cateLabel];
        [self accImage];
    }
    return self;
}


-(UIView *)lineView
{
    if (_lineView == nil) {
        UIView *lineView = [[UIView alloc] init];
        [self.contentView addSubview:lineView];
        lineView.backgroundColor = NumberColor(247, 247, 247);
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self);
            make.height.equalTo(@1);
            make.left.equalTo(self).offset(20);
            make.right.equalTo(self).offset(-20);
        }];
        _lineView = lineView;
    }
    return _lineView;
}


-(UILabel *)cateLabel
{
    if (_cateLabel == nil) {
        UILabel *cateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:cateLabel];
        cateLabel.textColor = NumberColor(165, 170, 180);
        cateLabel.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        cateLabel.textAlignment = NSTextAlignmentLeft;
        cateLabel.text = @"优股网";
        [cateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(rate375(20));
            make.centerY.equalTo(self);
        }];
        _cateLabel = cateLabel;
    }
    return _cateLabel;
}

-(UIImageView *)accImage
{
    if (_accImage == nil) {
        UIImageView *accImage = [[UIImageView alloc] init];
        [self.contentView addSubview:accImage];
        accImage.image = [UIImage imageNamed:@"wode-gd-grey"];
        [accImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self).offset(-rate375(20));
        }];
        _accImage = accImage;
    }
    return _accImage;
}



@end
